package com.bzframework.example.kafka;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @Author bingzhong
 * @Date 2025/9/15
 */
@Slf4j
@Component
public class KafkaConsumer {

    @KafkaListener(topics = "code-test", groupId = "test-group")
    public void onTestMessage(String message) {

        log.info("test value:" + message);

    }

    @KafkaListener(topics = "code-test", groupId = "test-group")
    public void onConsumerRecordMessage(ConsumerRecord<String, String> record) {

        log.info("record value:" + record);

    }


}
